#include "beep.h"
#include "ui_beep.h"
#include <QtWidgets/QPushButton>
#include <QtWidgets/QGridLayout>
#include <QMessageBox>
#include <QtWidgets/QDesktopWidget>
#define COLUMN_SPACING 20
Beep::Beep(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Beep)
{
    SetMainBacklight();


    ui->setupUi(this);
    ycapi = new Ycapi();

}
void Beep::SetMainBacklight()
{
QPalette bgpal = palette();
bgpal.setColor (QPalette::Background, QColor (0, 0 , 0, 255));
bgpal.setColor (QPalette::Foreground, QColor (255,0,0,255));
setPalette (bgpal);
}

Beep::~Beep()
{
    delete ui;
}

void Beep::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
void Beep::on_BeepOn_clicked()
{
    ycapi->BeepOn(true);
}

void Beep::on_BeepOff_clicked()
{
    ycapi->BeepOn(false);
}

void Beep::on_close_clicked()
{
    this->close();
}


